<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php



class MSecurity {
    
    public static function verification($keys, $post) {
        FXP::trace(FXP::t('Begin to process {class}::{function}',
            array('{class}'=>"MSecurity", '{function}'=>__FUNCTION__)));
        $argv = MSecurity::assemble_array($keys,$post);
        $expire_time        = @$post['expiration_date'];
        $digital_signature  = @$post['digital_signature'];
        FXP::trace(FXP::t("end to process {class}::FUNCTION: $expire_time ----$digital_signature".__FUNCTION__));
        $security = new MSecurityClass();
        return $security->verification($argv,$expire_time,$digital_signature);
    }
    
    public static function assemble_array($keys, $post) {
        $argv = array();
        foreach ($keys as $value) {
            if (array_key_exists($value,$post) == false) {
                return array();
            }
            $argv[$value] = $post[$value];
        }
        return $argv;
    }

}
?>